<div class="bg_greenyellow round_10 quarter shadow_in_0">
    <ul class="rightmenu">
        <li><a href="<?php echo $this->url(array('action'=>'index','controller'=>'commodities','module'=>'admin'),null,true); ?>">Towary</a></li>
        <li><a href="<?php echo $this->url(array('action'=>'categories','controller'=>'commodities','module'=>'admin'),null,true); ?>">Kategorie</a></li>
        <li><a href="<?php echo $this->url(array('action'=>'types','controller'=>'commodities','module'=>'admin'),null,true); ?>">Słownik</a></li>
        <li><a href="<?php echo $this->url(array('action'=>'periods','controller'=>'commodities','module'=>'admin'),null,true); ?>">Terminy Dostaw</a></li>
    </ul>    
</div>
    
    
<div class="threequarter  vpad_10  fixed ">
    <?php   ?>
    <h6 class ="bg_mediumblue round_5 shadow_out_4">Słownik
    <?
        if(isset ($this->catName)){
            echo ' - Kategoria: '.$this->catName;
        }
    ?>
    </h6>
            </br>

       <?php if(empty($this->types)){
           echo '<div class="warning"><p>Nie dodano jeszcze terminów do słownika towarów albo podana kategoria nie posiada jeszcze zdefiniowanych towarów</p><div></div></div>';
       } else { ?>
   <table class="plain" width="100%">
       <caption>
      Słownik towarów
   </caption>
   <thead>
      <tr>
         <th style="width:5%">#</th>
         <th style="width:15%" scope="col">Nazwa</th>
         <th style="width:15%" scope="col">Kategoria</th>
         <th style="width:55%" scope="col">Opis</th>
         <th style="width:10%" scope="col"></th>

      </tr>
   </thead>
   <tfoot>
      <tr>
         <th>&nbsp;</th>
         <th>&nbsp;</th>
         <td>&nbsp;</td>
         <td>&nbsp;</td>
         <td>&nbsp;</td>

      </tr>
   </tfoot>

   <tbody>
      <?php foreach($this->types as $type){ ?>
      <tr>
         <th scope="row"><?php echo $type->getCommodityType_id(); ?></th>
         <td><?php echo $type->getName(); ?></td>
         <td><a href="<?php echo $this->url(array('action'=>'types','controller'=>'commodities','module'=>'admin','cat'=>$type->getCategory_id()),null,true); ?>"><?php echo $type->getCategoryName(); ?></a></td></td>
         <td><?php echo substr($type->getDescription(), 0, 150).' ...'; ?></td>
         <td><a class="view_button grey styled_button" href='<? echo $this->url(array('action'=>'edit-types','controller'=>'commodities','module'=>'admin','id'=>$type->getCommodityType_id()),null,true);?>'>Więcej</a></td>
         
        
      </tr> 
      <?php  }; ?>
   </tbody>
</table>
            <br />
            <a class="right cancel_button grey styled_button" href="<?php echo $this->url(array('action'=>'types','controller'=>'commodities','module'=>'admin'),null,true); ?>">Reset</a>
    <?php } ?>
    <hr />  
        <?php echo $this->paginationControl($this->types,
                                    'Sliding',
                                    'utility/my_paginator_helper.phtml'); ?>
    <br />  
    <h6 class ="bg_mediumblue round_5 shadow_out_4">Nowy termin słownikowy</h6>
        </br>

    <?php echo $this->typeForm; ?>
</div>